package com.example.lib;

import java.io.File;
import java.util.ArrayList;

import com.google.gson.Gson;

public class CollectEpub {
	public static ArrayList<String> arrName = new ArrayList<String>();
	public static ArrayList<String> walkdir(File dir) {
		String pdfPattern = ".epub";
		Gson gson = new Gson();
		File listFile[] = dir.listFiles();

		if (listFile != null) {
			for (int i = 0; i < listFile.length; i++) {

				if (listFile[i].isDirectory()) {
					walkdir(listFile[i]);
				} else {
					if (listFile[i].getName().endsWith(pdfPattern)) {
						// Do what ever u want
//						String in = gson.toJson(listFile[i]);
						arrName.add(listFile[i].getAbsolutePath());
					}
				}
			}
		}
		return arrName;
	}
}
